import {createRouter,createWebHistory} from 'vue-router'

const router = createRouter({
  history:createWebHistory(),
  routes:[
    {
      path:'/',
      redirect:'/main'
    },
    {
      path:'/login',
      component:()=>import("../views/user/LoginView.vue")
    },
    {
      path:'/register',
      component:()=>import("../views/user/RegisterView.vue")
    },
    {
      path:'/userInfo',
      component:()=>import("../views/user/UserInfoView.vue")
    },
    {
      path:'/main',
      component:()=>import("../views/main/MainView.vue"),
      children:[
        {
          //管理员增加投资
          path:'adminAddInvest',
          component:()=>import("../views/invest/AdminAddInvestView.vue")
        },
        {
          //管理员投资列表
          path:'adminInvestList',
          component:()=>import("../views/invest/AdminInvestListView.vue")
        },
        {
          //管理员修改投资
          path:'adminUpdateInvest',
          component:()=>import("../views/invest/AdminUpdateInvestView.vue")
        },
        {
          //管理员查看用户投资
          path:'adminInvestItemList',
          component:()=>import("../views/invest/AdminInvestItemListView.vue")
        },
        {//管理员查看用户投资明细
          path:'adminCheckUserInvest',
          component:()=>import("../views/invest/AdminCheckUserInvestView.vue")
        },
        {
          //管理员投资赎回列表
          path:'adminInvestRedeemList',
          component:()=>import("../views/invest/AdminInvestRedeemList.vue")
        },
        {
          //用户点击投资时用户进行投资
          path:'userInvestList',
          component:()=>import("../views/invest/UserInvestListView.vue")
        },
        {
          //用户投资页面
          path:'userInvest',
          component:()=>import("../views/invest/UserInvestView.vue")
        },
        {
          //用户投资赎回列表
          path:'userInvestRedeemList',
          component:()=>import("../views/invest/UserInvestRedeemList.vue")
        }
      ]
    }
  ]
})

export default router